package com.huawei.appgallery.forum.posts.card;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout.LayoutParams;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.azb;
import o.bzd.d;
import o.chy;
import o.eqx;
import o.evx;

public class ForumNewCampaignCard extends ForumCampaignCard {
    public ForumNewCampaignCard(Context context) {
        super(context);
    }

    public void ˏ(CardBean cardBean) {
        if (cardBean instanceof ForumNewCampaignCardBean) {
            ˎ((BaseCardBean) (ForumNewCampaignCardBean) cardBean);
            ForumNewCampaignCardBean forumNewCampaignCardBean = (ForumNewCampaignCardBean) cardBean;
            this.ˋ.setText(forumNewCampaignCardBean.ˊ());
            this.ˏ.setText(forumNewCampaignCardBean.ˏॱ());
            this.ˋ.setAlpha(1.0f);
            this.ˏ.setAlpha(1.0f);
            this.ˊ.setAlpha(1.0f);
            ˎ(forumNewCampaignCardBean);
            if (forumNewCampaignCardBean.ˋॱ()) {
                this.ˊ.setVisibility(0);
                ˏ((ForumCampaignCardBean) forumNewCampaignCardBean);
                return;
            }
            this.ˊ.setVisibility(8);
        }
    }

    protected void ˎ(ForumCampaignCardBean forumCampaignCardBean) {
        int ˎ = ˎ();
        this.ˎ.setLayoutParams(new LayoutParams(ˎ, (int) (((double) ˎ) / 1.7777777777777777d)));
        eqx.ˏ(this.ˎ, forumCampaignCardBean.ॱˌ(), "image_default_icon");
    }

    protected int ˎ() {
        return azb.ॱ(this.ʼॱ) - (this.ʼॱ.getResources().getDimensionPixelSize(d.ॱॱ) * 2);
    }

    public void ॱ(final chy o_chy) {
        View ˉ = ˉ();
        if (ˉ != null) {
            ˉ.setOnClickListener(new evx(this) {
                final /* synthetic */ ForumNewCampaignCard ˎ;

                public void ˋ(View view) {
                    if (o_chy != null) {
                        o_chy.ˏ(0, this.ˎ);
                    }
                }
            });
        }
    }
}
